package com.hzdl.hotel.util;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

@Setter
@Getter
@NoArgsConstructor
@ToString
public class AJAXResult {
    private Integer code;
    private String msg;
    private Object data;
    private Long count;

    public AJAXResult(Integer code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }
    public AJAXResult(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public AJAXResult(Integer code) {
        this.code = code;
    }

    public AJAXResult(Object data) {
        this.data = data;
    }

    public AJAXResult(Integer code, Object data) {
        this.code = code;
        this.data = data;
    }

    public AJAXResult(Integer code, String msg, Object data, Long count) {
        this.code = code;
        this.msg = msg;
        this.data = data;
        this.count = count;
    }

    // 添加成功
    public static final AJAXResult ADD_SUCCESS = new AJAXResult(SysConstast.CODE_SUCCESS,SysConstast.ADD_SUCCESS);
    //添加失败
    public static final AJAXResult ADD_ERROR = new AJAXResult(SysConstast.CODE_ERROR,SysConstast.ADD_ERROR);
    //更新成功
    public static final AJAXResult UPDATE_SUCCESS = new AJAXResult(SysConstast.CODE_SUCCESS,SysConstast.UPDATE_SUCCESS);
    //更新失败
    public static final AJAXResult UPDATE_ERROR = new AJAXResult(SysConstast.CODE_ERROR,SysConstast.UPDATE_ERROR);
    //删除成功
    public static final AJAXResult DELETE_SUCCESS = new AJAXResult(SysConstast.CODE_SUCCESS,SysConstast.DELETE_SUCCESS);
    //删除失败
    public static final AJAXResult DELETE_ERROR = new AJAXResult(SysConstast.CODE_ERROR,SysConstast.DELETE_ERROR);
    //重置成功
    public static final AJAXResult RESET_SUCCESS = new AJAXResult(SysConstast.CODE_SUCCESS,SysConstast.RESET_SUCCESS);
    //重置失败
    public static final AJAXResult RESET_ERROR = new AJAXResult(SysConstast.CODE_ERROR,SysConstast.RESET_ERROR);
    //分配成功
    public static final AJAXResult DISPATCH_SUCCESS = new AJAXResult(SysConstast.CODE_SUCCESS,SysConstast.DISPATCH_SUCCESS);
    //分配失败
    public static final AJAXResult DISPATCH_ERROR = new AJAXResult(SysConstast.CODE_ERROR,SysConstast.DISPATCH_ERROR);
    //状态码0 成功
    public static final AJAXResult STATUS_TRUE = new AJAXResult(SysConstast.CODE_SUCCESS);
    //状态码-1 失败
    public static final AJAXResult STATUS_FALSE = new AJAXResult(SysConstast.CODE_ERROR);



}
